package com.yinhe.music.yhmusic.utils;

import android.content.Context;

import com.umeng.analytics.MobclickAgent;

import java.util.HashMap;

public class UmengEventUtils {

    /**
     * plf
     */
    public static final String QQ = "qq";
    public static final String PHONE = "phone";
    public static final String WECHAT = "wechat";
    public static final String SINA = "sina";

    /**
     * editInfo
     */
    public static final String USER_IMAGE = "用户头像";
    public static final String USER_NAME = "用户名";

    /**
     * month
     */
    public static final String ONE = "一个月";
    public static final String THREE = "三个月";
    public static final String SIX = "六个月";

    /**
     * icon
     */
    public static final String ONE_ICON = "1雪币";
    public static final String THREE_ICON = "3雪币";
    public static final String SIX_ICON = "6雪币";
    public static final String EIGHT_ICON = "8雪币";

    /**
     * collection
     */
    public static final String SINGER = "歌手";
    public static final String MV = "视频";
    public static final String ALBUM = "专辑";
    public static final String RAIDO = "电台";
    public static final String SONG_MENU = "歌单";
    public static final String SONG = "歌曲";
    public static final String AUTO_LISTEN = "随心听";
    public static final String RAIDO_SONG = "电台节目";
    public static final String INSTRUMENT = "乐器";
    /**
     * download
     */
    public static final String SINGLE = "单曲下载";
    public static final String MULTI = "批量下载";

    /**
     * 风格选择
     *
     * @param context
     * @param style
     */
    public static void clickStyle(Context context, int style) {
        HashMap<String, String> map = new HashMap<>(1);
        if (style == 0) {
            map.put("选择风格", "藏族音乐");
        } else {
            map.put("选择风格", "花儿音乐");
        }
        MobclickAgent.onEvent(context, "style", map);
    }

    /**
     * 注册统计
     *
     * @param context
     */
    public static void register(Context context) {
        MobclickAgent.onEvent(context, "register");
    }

    /**
     * 登录统计
     *
     * @param context
     * @param plf     平台
     */
    public static void login(Context context, String plf) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("登录平台", plf);
        MobclickAgent.onEvent(context, "login", map);
    }

    /**
     * 登出
     * @param context
     */
    public static void clickLogout(Context context) {
        MobclickAgent.onEvent(context, "logout");
    }

    /**
     * 修改用户信息统计
     *
     * @param context
     * @param editInfo 修改内容
     */
    public static void editUserInfo(Context context, String editInfo) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("修改个人信息", editInfo);
        MobclickAgent.onEvent(context, "edituserinfo", map);
    }

    /**
     * 购买VIP
     * @param context
     * @param month 修改内容
     */
    public static void buyVip(Context context, String month) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("购买时长", month);
        MobclickAgent.onEvent(context, "vip", map);
    }

    /**
     * 购买歌曲
     * @param context
     */
    public static void buyMusic(Context context) {
        MobclickAgent.onEvent(context, "buy");
    }

    /**
     * 购买雪币
     * @param context
     */
    public static void buyIcon(Context context,String icon) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("充值金额", icon);
        MobclickAgent.onEvent(context, "icon");
    }

    /**
     * 收藏内容
     * @param context
     */
    public static void collect(Context context,String collection) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("收藏内容", collection);
        MobclickAgent.onEvent(context, "collect",map);
    }

    /**
     * 创建歌单
     * @param context
     */
    public static void createMenu(Context context) {
        MobclickAgent.onEvent(context, "createsongmenu");
    }

    /**
     * 推荐点击
     * @param context
     */
    public static void clickRecommend(Context context,String recommend) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("推荐点击", recommend);
        MobclickAgent.onEvent(context, "recommend",map);
    }

    /**
     * 首页点击
     * @param context
     */
    public static void clickHome(Context context,String click) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("首页点击", click);
        MobclickAgent.onEvent(context, "homeclick",map);
    }

    /**
     * 播放视频
     * @param context
     */
    public static void playVideo(Context context) {
        MobclickAgent.onEvent(context, "playvideo");
    }

    /**
     * 播放歌曲
     * @param context
     */
    public static void playMusic(Context context) {
        MobclickAgent.onEvent(context, "playsong");
    }


    /**
     * 评论
     * @param context
     */
    public static void comment(Context context) {
        MobclickAgent.onEvent(context, "comment");
    }

    /**
     * 下载操作
     * @param context
     */
    public static void clickDownload(Context context,String down) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("下载操作", down);
        MobclickAgent.onEvent(context, "download",map);
    }

    /**
     * 分享内容
     * @param context
     */
    public static void clickShare(Context context,String share) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("分享内容", share);
        MobclickAgent.onEvent(context, "share",map);
    }

    /**
     * 搜索结果点击统计
     * @param context
     */
    public static void clickSearch(Context context,String search) {
        HashMap<String, String> map = new HashMap<>(1);
        map.put("搜索结果", search);
        MobclickAgent.onEvent(context, "search",map);
    }

    /**
     * 更新
     * @param context
     */
    public static void clickUpdate(Context context) {
        MobclickAgent.onEvent(context, "update");
    }


}
